package com.avcdata.aoscustommade.presenter;

import com.avcdata.aoscustommade.activity.Welcome_Activity;
import com.avcdata.aoscustommade.bean.DateSelectCategoryBean;
import com.avcdata.aoscustommade.main.BaseCallBack;
import com.avcdata.aoscustommade.model.CityDatailActivityModel;
import com.avcdata.aoscustommade.model.WelcomeViewModel;
import com.avcdata.aoscustommade.view.WelcomeView;

import org.json.JSONObject;

/**
 * 欢迎界面的p
 * Created by zyh on 17/6/12.
 */

public class WelcomePresenter {
    private final WelcomeView welcomeView;
    private final WelcomeViewModel welcomeViewModel;

    public WelcomePresenter(WelcomeView welcomeView, WelcomeViewModel welcomeViewModel) {
        this.welcomeView = welcomeView;
        this.welcomeViewModel = welcomeViewModel;
    }

    /**
     * 获取当前周
     * @param lastWeekCount
     */
    public void loadGetDateSelectCategory(String lastWeekCount) {
        welcomeViewModel.loadSelectCategory(lastWeekCount, new BaseCallBack() {
            @Override
            public void onSuccess(Object object) {
                welcomeView.loadGetDateSelectCategorySuccess((JSONObject)object);
            }

            @Override
            public void onFailure() {

            }

            @Override
            public void onFailure(Throwable throwable) {

            }
        });
    }
}
